<?php
/**
* Nguoi tao: Phuongtt
* Ngay tao: 06/08/2009
* Y nghia: Lop xu ly theo doi van ban den
*/

class fulltextsearch_modFulltextsearch extends Efy_DB_Connection {	

	/**
	 * y nghia: lay danh sach van ban
	 *
	 * @param unknown_type $iOwnerId
	 * @param unknown_type $iYear
	 * @param unknown_type $sFullTextSearch
	 * @param unknown_type $iPage
	 * @param unknown_type $iNumberRecordPerPage
	 * @return unknown
	 */
	public function DocFullTextSearchDocGetAll($iOwnerId,$iYear, $sFullTextSearch, $iPage, $iNumberRecordPerPage){		
		$sql = "Exec Doc_FullTextSearchDocGetAll ";
		$sql = $sql . "'" . $iOwnerId . "'";
		$sql = $sql . ",'" . $iYear . "'";
		$sql = $sql . ",'" . $sFullTextSearch . "'";
		$sql = $sql . ",'" . $iPage . "'";
		$sql = $sql . ",'" . $iNumberRecordPerPage . "'";
	//	echo '<br>'.$sql . '<br>'; //exit;
		try{
			$arrDoc = $this->adodbQueryDataInNameMode($sql);
		}catch (Exception $e){
			echo $e->getMessage();
		}
		return $arrDoc;
	}
	public function getPropertiesDocument($code){
		$sql = "EfyLib_ListGetAllbyCode ";
		$sql = $sql . "'" . $code . "', ''";
		try {
			$arrSel = $this->adodbQueryDataInNameMode($sql);
		}catch (Exception $e){
			echo $e->getMessage();
		}
		return $arrSel;
	}
	/**
	 * Y nghia: lay thong tin chi tiet mot van ban
	 *
	 * @param unknown_type $sDocumentId
	 * @param unknown_type $sType
	 * @return unknown
	 */
	public function DocFullTextSearchDocGetSingle($sDocumentId, $sType){
		$sql = "Exec [dbo].[Doc_FullTextSearchDocGetSingle] ";
		$sql .= "'" . $sDocumentId . "'";
		$sql .= ",'" . $sType . "'";
		//echo $sql . '<br>'; //exit;
		try{
			$arrDocSingle = $this->adodbQueryDataInNameMode($sql);
		}catch (Exception $e){
			echo $e->getMessage();
		};		
		return $arrDocSingle;
	}
}
